<template>
  <div id="page-wrapper" class="gray-bg">
    <header-link/>
    <div class="row wrapper border-bottom white-bg page-heading">
      <div class="col-sm-4">
        <h2>课程描述详情</h2>
        <ol class="breadcrumb">
          <li>
            <router-link :to="{ name: 'home' }">
              主页
            </router-link>
          </li>
          <li class="active">
            <strong>课程描述详情</strong>
          </li>
        </ol>
      </div>
    </div>


    <div class="wrapper container wrapper-content animated fadeInUp">
      <div class="ibox">
        <div class="ibox-title">
          <h5>新增</h5>
          <div class="ibox-tools">
            <router-link :to="{ name: 'courseDescription'}" class="btn btn-primary btn-xs">
              <i class="fa fa-back"></i>
              返回列表
            </router-link>
          </div>
        </div>
        <div class="ibox-content">
            <form class="form-horizontal">

              <div class="form-group">
                <label class="col-lg-2 control-label">
                  学校名称
                </label>
                  <div class="col-lg-10 margin-top-6px">
                    <span v-text="form.schoolname"></span>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">
                  课程名称
                </label>
                  <div class="col-lg-10 margin-top-6px">
                    <span v-text="form.name"></span>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">
                  课程类别
                </label>
                  <div class="col-lg-10 margin-top-6px">
                    <span v-text=" (form.other3 && form.other3 != 0) ? common.enum.courseType[form.other3] : '-' "></span>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">主要内容</label>
                  <div class="col-lg-10 margin-top-6px">
                    <pre v-html="form.other1"></pre>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">课程描述</label>
                  <div class="col-lg-10 margin-top-6px">
                    <span v-text="form.description"></span>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">课本（literature）</label>
                  <div class="col-lg-10 margin-top-6px">
                    <span v-text="form.other2"></span>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">编辑人</label>
                  <div class="col-lg-10 margin-top-6px">
                    <span v-text="form.lastedit"></span>
                  </div>
              </div>

            </form>
        </div>

      </div>
    </div>
    
  </div>

</template>

<script>
import header from '@/components/Header.vue'
import server from '@/server/server.js'
import common from '@/server/common.js'
export default {
  name: 'demo',
  data () {
    return {
      common: common,
      form: {
        id: '',
        schoolname: '',
        name: '',
        lastedit: '',
        other1: '',
        description: '',
      },

    }
  },
  components: {
    'header-link': header
  },
  created () {
  },
  mounted () {
      var vue = this;
      // 获取课程描述
      const params = "id=" + vue.$route.query.id;
      server.get(server.getCourseDescriptionByIdUrl, null, params, true, false, this, function(data) {
          vue.form = data;
      })

  },
  methods: {
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
#page-wrapper {
  margin: 0;
}
.container {
  margin-top: 20px;
}
.margin-top-6px {
  margin-top: 6px;
}
</style>
